<template>
	<view>
		<u-navbar placeholder fixed autoBack border title="实名详情"></u-navbar>
		<view class="d-p-30" v-if="info">
			<view class="d-font-32" style="font-weight: bold;color: #151C24;">实名制信息</view>
			<view class="d-font-28 d-m-t-20">
				<view class="d-flex u-border-bottom" style="height: 80rpx;">
					<view class="d-m-r-30" style="color: #5D6672;">人员姓名</view>
					<view class="d-flex-1 d-text-right">{{ info.xm }}</view>
				</view>
			</view>
			<view class="d-font-28">
				<view class="d-flex u-border-bottom" style="height: 80rpx;">
					<view class="d-m-r-30" style="color: #5D6672;">公民身份号码</view>
					<view class="d-flex-1 d-text-right">{{ info.zjhm }}</view>
				</view>
			</view>
			<view class="d-font-28">
				<view class="d-flex u-border-bottom" style="height: 80rpx;">
					<view class="d-m-r-30" style="color: #5D6672;">出生日期</view>
					<view class="d-flex-1 d-text-right">{{ info.csrq }}</view>
				</view>
			</view>
			<view class="d-font-28">
				<view class="d-flex u-border-bottom" style="height: 80rpx;">
					<view class="d-m-r-30" style="color: #5D6672;">性别</view>
					<view class="d-flex-1 d-text-right">{{ dict.xb || _dict(info.xb, 'xb') }}</view>
				</view>
			</view>
			<view class="d-font-28">
				<view class="d-flex u-border-bottom" style="height: 80rpx;">
					<view class="d-m-r-30" style="color: #5D6672;">民族</view>
					<view class="d-flex-1 d-text-right">{{ dict.mz || _dict(info.mz, 'mz') }}</view>
				</view>
			</view>
			<view class="d-font-28" v-if="info.jiGuan">
				<view class="d-flex u-border-bottom" style="height: 80rpx;">
					<view class="d-m-r-30" style="color: #5D6672;">籍贯</view>
					<view class="d-flex-1 d-text-right">{{ info.jiGuan }}</view>
				</view>
			</view>
			<view class="d-font-28">
				<view class="d-flex u-border-bottom" style="height: 80rpx;">
					<view class="d-m-r-30" style="color: #5D6672;">住址</view>
					<view class="d-flex-1 d-text-right">{{ info.hjszd }}</view>
				</view>
			</view>
			<view class="d-font-28">
				<view class="d-flex u-border-bottom" style="height: 80rpx;">
					<view class="d-m-r-30" style="color: #5D6672;">签发机关</view>
					<view class="d-flex-1 d-text-right">{{ info.qfjg }}</view>
				</view>
			</view>
			<view class="d-font-28">
				<view class="d-flex u-border-bottom" style="height: 80rpx;">
					<view class="d-m-r-30" style="color: #5D6672;">有效期限开始</view>
					<view class="d-flex-1 d-text-right">{{ info.yxksrq }}</view>
				</view>
			</view>
			<view class="d-font-28">
				<view class="d-flex u-border-bottom" style="height: 80rpx;">
					<view class="d-m-r-30" style="color: #5D6672;">有效期限结束</view>
					<view class="d-flex-1 d-text-right">{{ info.yxjsrq }}</view>
				</view>
			</view>
			<view class="d-font-28">
				<view class="d-flex u-border-bottom" style="height: 80rpx;">
					<view class="d-m-r-30" style="color: #5D6672;">手机号码</view>
					<view class="d-flex-1 d-text-right">{{ info.lxfs }}</view>
				</view>
			</view>

			<view class="d-font-32 d-m-t-50" style="font-weight: bold;color: #151C24;">合同信息</view>
			<view class="d-font-28">
				<view class="d-flex u-border-bottom" style="height: 80rpx;">
					<view class="d-m-r-30" style="color: #5D6672;">是否签订合同</view>
					<view class="d-flex-1 d-text-right">{{ info.sflwht == 1 ? '是' : '否' }}</view>
				</view>
			</view>
			<view class="d-font-28" v-if="info.sflwht == 1">
				<view class="d-flex u-border-bottom" style="height: 80rpx;">
					<view class="d-m-r-30" style="color: #5D6672;">合同类型</view>
					<view class="d-flex-1 d-text-right">{{ dict.htlx || _dict(info.htlx, 'htlx') }}</view>
				</view>
			</view>
			<view class="d-font-28" v-if="info.sflwht == 1">
				<view class="d-flex u-border-bottom" style="height: 80rpx;">
					<view class="d-m-r-30" style="color: #5D6672;">合同签订时间</view>
					<view class="d-flex-1 d-text-right">{{ info.htqdsj }}</view>
				</view>
			</view>
			<view class="d-font-28" v-if="info.sflwht == 1">
				<view class="d-flex u-border-bottom" style="height: 80rpx;">
					<view class="d-m-r-30" style="color: #5D6672;">合同起始时间</view>
					<view class="d-flex-1 d-text-right">{{ info.htqssj }}</view>
				</view>
			</view>
			<view class="d-font-28" v-if="info.sflwht == 1">
				<view class="d-flex u-border-bottom" style="height: 80rpx;">
					<view class="d-m-r-30" style="color: #5D6672;">合同终止时间</view>
					<view class="d-flex-1 d-text-right">{{ info.htzzsj }}</view>
				</view>
			</view>
			<view class="d-font-28" v-if="info.sflwht == 1">
				<view class="d-flex u-border-bottom" style="height: 80rpx;">
					<view class="d-m-r-30" style="color: #5D6672;">合同编号</view>
					<view class="d-flex-1 d-text-right">{{ info.lwhtbh }}</view>
				</view>
			</view>
			<view class="d-font-28" v-if="info.sflwht == 1">
				<view class="d-flex u-border-bottom" style="height: 80rpx;">
					<view class="d-m-r-30" style="color: #5D6672;">工资计算方式</view>
					<view class="d-flex-1 d-text-right">{{ dict.jxfs || _dict(info.gzjsfs, 'jxfs') }}</view>
				</view>
			</view>
			<view class="d-font-28" v-if="info.sflwht == 1">
				<view class="d-flex u-border-bottom" style="height: 80rpx;">
					<view class="d-m-r-30" style="color: #5D6672;">工资标准</view>
					<view class="d-flex-1 d-text-right">{{ info.sflwht }}</view>
				</view>
			</view>
			<view class="d-font-28" v-if="info.sflwht == 1">
				<view class="d-flex u-border-bottom" style="height: 80rpx;">
					<view class="d-m-r-30" style="color: #5D6672;">工资支付日</view>
					<view class="d-flex-1 d-text-right">{{ info.gzzfrq }}</view>
				</view>
			</view>
			
			<view class="d-font-32 d-m-t-50" style="font-weight: bold;color: #151C24;">工资卡信息</view>
			<view class="d-font-28">
				<view class="d-flex u-border-bottom" style="height: 80rpx;">
					<view class="d-m-r-30" style="color: #5D6672;">工资卡类别</view>
					<view class="d-flex-1 d-text-right">{{ dict.gzklb || _dict(info.gzklb, 'gzklb') }}</view>
				</view>
			</view>
			<view class="d-font-28" v-if="info.gzklb == 2">
				<view class="d-flex u-border-bottom" style="height: 80rpx;">
					<view class="d-m-r-30" style="color: #5D6672;">工资卡开卡银行</view>
					<view class="d-flex-1 d-text-right">{{ dict.jyjgbm || _dict(info.khhyh, 'jyjgbm') }}</view>
				</view>
			</view>
			<view class="d-font-28" v-if="info.gzklb == 2">
				<view class="d-flex u-border-bottom" style="height: 80rpx;">
					<view class="d-m-r-30" style="color: #5D6672;">开户行行号</view>
					<view class="d-flex-1 d-text-right">{{ info.khhdm }}</view>
				</view>
			</view>
			<view class="d-font-28" v-if="info.gzklb == 2">
				<view class="d-flex u-border-bottom" style="height: 80rpx;">
					<view class="d-m-r-30" style="color: #5D6672;">工资卡号</view>
					<view class="d-flex-1 d-text-right">{{ info.gzkkh }}</view>
				</view>
			</view>
			<view class="d-font-28" v-if="info.gzklb == 1">
				<view class="d-flex u-border-bottom" style="height: 80rpx;">
					<view class="d-m-r-30" style="color: #5D6672;">社保卡号</view>
					<view class="d-flex-1 d-text-right">{{ info.sbkkh }}</view>
				</view>
			</view>
			
			<view class="d-font-32 d-m-t-50" style="font-weight: bold;color: #151C24;">其他信息</view>
			<view class="d-font-28">
				<view class="d-flex u-border-bottom" style="height: 80rpx;">
					<view class="d-m-r-30" style="color: #5D6672;">是否参加基本安全培训</view>
					<view class="d-flex-1 d-text-right">{{ info.sfcjjbaqpx == 1 ? '是' : '否' }}</view>
				</view>
			</view>
			<view class="d-font-28">
				<view class="d-flex u-border-bottom" style="height: 80rpx;">
					<view class="d-m-r-30" style="color: #5D6672;">职称/岗位证书</view>
					<view class="d-flex-1 d-text-right">{{ info.zcgwzs }}</view>
				</view>
			</view>
			<view class="d-font-28">
				<view class="d-flex u-border-bottom" style="height: 80rpx;">
					<view class="d-m-r-30" style="color: #5D6672;">技能水平/等级</view>
					<view class="d-flex-1 d-text-right">{{ info.jnspdj }}</view>
				</view>
			</view>
			<view class="d-font-28">
				<view class="d-flex u-border-bottom" style="height: 80rpx;">
					<view class="d-m-r-30" style="color: #5D6672;">婚姻状况</view>
					<view class="d-flex-1 d-text-right">{{ dict['hyzk-cxcj'] || _dict(info['hyzk'], 'hyzk-cxcj') }}</view>
				</view>
			</view>
			<view class="d-font-28">
				<view class="d-flex u-border-bottom" style="height: 80rpx;">
					<view class="d-m-r-30" style="color: #5D6672;">政治面貌</view>
					<view class="d-flex-1 d-text-right">{{ dict.zzmm || _dict(info.zzmm, 'zzmm') }}</view>
				</view>
			</view>
			<view class="d-font-28">
				<view class="d-flex u-border-bottom" style="height: 80rpx;">
					<view class="d-m-r-30" style="color: #5D6672;">是否加入工会</view>
					<view class="d-flex-1 d-text-right">{{ info.sfjrgh == 1 ? '是' : '否' }}</view>
				</view>
			</view>
			<view class="d-font-28" v-if="info.sfjrgh == 1">
				<view class="d-flex u-border-bottom" style="height: 80rpx;">
					<view class="d-m-r-30" style="color: #5D6672;">加入公会时间</view>
					<view class="d-flex-1 d-text-right">{{ info.jrghsj }}</view>
				</view>
			</view>
			<view class="d-font-28">
				<view class="d-flex u-border-bottom" style="height: 80rpx;">
					<view class="d-m-r-30" style="color: #5D6672;">是否有重大疾病史</view>
					<view class="d-flex-1 d-text-right">{{ info.sfyzdjbs == 1 ? '是' : '否' }}</view>
				</view>
			</view>
			<view class="d-font-28" v-if="info.jjlxrxm">
				<view class="d-flex u-border-bottom" style="height: 80rpx;">
					<view class="d-m-r-30" style="color: #5D6672;">紧急联系人</view>
					<view class="d-flex-1 d-text-right">{{ info.jjlxrxm }}</view>
				</view>
			</view>
			<view class="d-font-28" v-if="info.jjlxdh">
				<view class="d-flex u-border-bottom" style="height: 80rpx;">
					<view class="d-m-r-30" style="color: #5D6672;">紧急联系人电话</view>
					<view class="d-flex-1 d-text-right">{{ info.jjlxdh }}</view>
				</view>
			</view>
			<!-- <view class="d-font-28 d-m-t-20">
				<view class="d-flex u-border-bottom" style="height: 80rpx;">
					<view class="d-m-r-30" style="color: #5D6672;">户籍分类</view>
					<view class="d-flex-1 d-text-right">{{ dict.hjfl || _dict(info.sdfl, 'hjfl') }}</view>
				</view>
			</view> -->
			
			
			<!-- <view class="d-font-28">
				<view class="d-flex u-border-bottom" style="height: 80rpx;">
					<view class="d-m-r-30" style="color: #5D6672;">文化程度</view>
					<view class="d-flex-1 d-text-right">{{ dict.whcd || _dict(info.whcd, 'whcd') }}</view>
				</view>
			</view> -->
			<!-- <view class="d-font-28">
				<view class="d-flex u-border-bottom" style="height: 80rpx;">
					<view class="d-m-r-30" style="color: #5D6672;">开始工作时间</view>
					<view class="d-flex-1 d-text-right">{{ info.ksgzrq }}</view>
				</view>
			</view> -->
			

			
			<view class="d-font-28" v-if="info.cyyx">
				<view class="d-flex u-border-bottom" style="height: 80rpx;">
					<view class="d-m-r-30" style="color: #5D6672;">邮箱</view>
					<view class="d-flex-1 d-text-right">{{ info.cyyx }}</view>
				</view>
			</view>
			<view class="d-font-28" v-if="info.teChang">
				<view class="d-flex u-border-bottom" style="height: 80rpx;">
					<view class="d-m-r-30" style="color: #5D6672;">特长</view>
					<view class="d-flex-1 d-text-right">{{ info.teChang }}</view>
				</view>
			</view>

			<view class="d-font-32 d-m-t-50" style="font-weight: bold;color: #151C24;">人员进场信息</view>
			<view class="d-font-28 d-m-t-20">
				<view class="d-flex u-border-bottom" style="height: 80rpx;">
					<view class="d-m-r-30" style="color: #5D6672;">班组名称</view>
					<view class="d-flex-1 d-text-right">{{ info.bzmc }}</view>
				</view>
			</view>
			<view class="d-font-28">
				<view class="d-flex u-border-bottom" style="height: 80rpx;">
					<view class="d-m-r-30" style="color: #5D6672;">是否班组长</view>
					<view class="d-flex-1 d-text-right">{{ info.sfzz == 1 ? '是' : '否' }}</view>
				</view>
			</view>
			<view class="d-font-28">
				<view class="d-flex u-border-bottom" style="height: 80rpx;">
					<view class="d-m-r-30" style="color: #5D6672;">角色</view>
					<view class="d-flex-1 d-text-right">{{ dict.role || _dict(info.gwlx, 'role') }}</view>
				</view>
			</view>
			<view class="d-font-28">
				<view class="d-flex u-border-bottom" style="height: 80rpx;">
					<view class="d-m-r-30" style="color: #5D6672;">从事工种</view>
					<view class="d-flex-1 d-text-right">{{ dict.worktype || _dict(info.zwzc, 'worktype') }}</view>
				</view>
			</view>
			
			

			<view class="d-font-32 d-m-t-50" style="font-weight: bold;color: #151C24;">审核结果</view>
			<view class="d-font-28 d-m-t-20">
				<view class="d-flex u-border-bottom" style="height: 80rpx;">
					<view class="d-m-r-30" style="color: #5D6672;">审批意见</view>
					<view class="d-flex-1 d-text-right">{{ info.shyj || '无数据源' }}</view>
				</view>
			</view>
			<view class="d-font-28">
				<view class="d-flex u-border-bottom" style="height: 80rpx;">
					<view class="d-m-r-30" style="color: #5D6672;">审批人</view>
					<view class="d-flex-1 d-text-right">{{ info.shry }}</view>
				</view>
			</view>
			<view class="d-font-28">
				<view class="d-flex u-border-bottom" style="height: 80rpx;">
					<view class="d-m-r-30" style="color: #5D6672;">审批时间</view>
					<view class="d-flex-1 d-text-right">{{ info.shsj }}</view>
				</view>
			</view>
			<view class="d-font-28">
				<view class="d-flex u-border-bottom" style="height: 80rpx;">
					<view class="d-m-r-30" style="color: #5D6672;">审批状态</view>
					<view class="d-flex-1 d-text-right">{{ info.shjg == 1 ? '通过' : '不通过' }}</view>
				</view>
			</view>

			<view class="d-font-32 d-m-t-50" style="font-weight: bold;color: #151C24;">附件</view>
			<view class="table d-m-t-30">
				<view class="tr">
					<view class="th d-p-l-30">序号</view>
					<view class="th">附件</view>
					<view class="th">数量</view>
				</view>
				<template v-if="file && file.length > 0">
					<view class="tr" v-for="(item, index) in file" :key="index" @click="fileInfo(item)">
						<view class="td d-p-l-30">{{ index + 1 }}</view>
						<view class="td">
							<text style="color: #21A5F3;">{{ item.attachName }}</text>
						</view>
						<view class="td">{{ item.count }}</view>
					</view>
				</template>
			</view>
			<view class="d-flex d-row-center d-p-t-20" v-if="!file || file.length <= 0">
				<view><u-empty mode="list" icon="/static/image/none.png" text="暂无附件信息"></u-empty></view>
			</view>
		</view>
	</view>
</template>

<script>
import { authDetail, getDictInfo, getAtta } from '../../../common/api.js';
export default {
	data() {
		return {
			info: null,
			dict: {
				xb: '',
				mz: '',
				hjfl: '',
				zzmm: '',
				'hyzk-cxcj': '',
				whcd: '',
				role: '',
				worktype: '',
				htlx: '',
				jxfs: '',
				gzklb: '',
				jyjgbm: ''
			},
			file: []
		};
	},
	onLoad(e) {
		authDetail({
			params: {
				id: e.id
			}
		}).then(e => {
			this.info = e.data;
			getAtta({
				params: {
					ywlx: 'salary_smzgl_ryxx_smrz',
					ywbh: e.data.id
				}
			}).then(e => {
				this.file = e.data;
			})
		});
	},
	methods: {
		dictInfo(v, n) {
			return getDictInfo({
				params: {
					dictType: n,
					dictValue: v
				}
			}).then(e => {
				return e.data;
			});
		},
		fileInfo(item) {
			let list = item.attachList;
			if (!list) {
				return uni.$u.toast('暂无附件');
			}
			uni.previewImage({
				urls: list.map(e => {
					return e.attachUrl;
				}),
				indicator: 'number',
				loop: true,
				fail: e => {
					console.error(e);
					uni.$u.toast('系统繁忙, 请稍后再试!');
				}
			});
		},
	},
	computed: {
		_dict() {
			return function(v, n) {
				this.dictInfo(v, n).then(e => {
					this.dict[n] = e;
				});
			};
		}
	}
};
</script>

<style lang="scss">
page {
	background-color: #fbfcfc;

	.table {
		font-size: 28rpx;
		display: table;
		width: 100%;
		vertical-align: middle;
		border: 1px solid #f6f7f8;
		.tr {
			display: table-row;
			.th,
			.td {
				display: table-cell;
				height: 80rpx;
				vertical-align: middle;
			}
			.th {
				font-weight: bold;
				color: #162233;
			}
			&:nth-child(2n-1) {
				background-color: #f6f7f8;
			}
		}
	}
}
</style>
